<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	procTypeCd		= Request("procTypeCd")
	fullLotNo		= Request("fullLotNo")
	
	SQLTitle = "-- ■■■■ 공정그룹 상세 정보 ■■■■"
	
	SQL = "SELECT processCds FROM tblProcSet WHERE procTypeCd='" & procTypeCd & "'"

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<ProcSetDetail>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
			divProc = Split(rs("processCds"),",")
			For i=0 To UBound(divProc)
				If divProc(i) <> "" And oldOroc <> divProc(i) Then 
					If procSet <> "" Then 
						procSet = procSet & " -> "
						procTypes = procTypes & ","
					End If 
					procNm = aFieldValue("SELECT processNm+'^'+type FROM tblUnitProcess WHERE processCd='" & divProc(i) & "'")
					divProcNm = Split(procNm,"^")
					procSet = procSet & "[<b>" & (i+1) & "</b>. " & divProcNm(0) & "]"
					procTypes = procTypes & divProcNm(1)
				End If 
				procCnt = aFieldValue("SELECT count(*) FROM tblOrderResult WHERE processCd='" & divProc(i) & "' AND lotYear+lotNo='" & fullLotNo & "'")
				procCd = ""
				For k=0 To procCnt - 1
					If procCd <> "" Then procCd = procCd & "/" End If 
					procCd = procCd & divProc(i) 
				Next 
				If procCd <> "" Then 
					allProcCds = allProcCds & procCd & ","
				End If 
				oldOroc = divProc(i) 
			Next 
			isProc = aFieldValue("SELECT count(*) FROM tblOrderResult WHERE lotYear+lotNo='" & fullLotNo & "'")
			If isProc = 0 Then 
				allProcCds = rs("processCds")
			End If 

			Call mkXMLNode("procSet", procSet, 1)
			Call mkXMLNode("processCds", rs("processCds"), 1)
			Call mkXMLNode("procTypes", procTypes, 1)
			Call mkXMLNode("allProcCds", allProcCds, 1)


		Rs.movenext
		Loop 
	End If
	Response.write "</ProcSetDetail>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>